<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改生产（育苗）阶段')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ncStage-edit" th:object="${ncStage}">
            <input id="stageId" name="stageId" th:field="*{stageId}"  type="hidden">
			<input id="standardId" name="standardId" th:field="*{standardId}" type="hidden">
			<input id="stageDetail" name="stageDetail" th:field="*{stageDetail}"  type="hidden">

			<div class="form-group">	
				<label class="col-sm-3 control-label">阶段名称：</label>
				<div class="col-sm-8">
					<input id="stageName" name="stageName" required th:field="*{stageName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">阶段天数：</label>
				<div class="col-sm-8">
					<input id="stageDays" name="stageDays" required th:field="*{stageDays}" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">排序号：</label>
				<div class="col-sm-8">
					<input id="orderNum" name="orderNum" required th:field="*{orderNum}" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">阶段描述：</label>
			</div>

			<div class="form-group">
				<div id="editor" type="text/plain" style="width:1024px;height:500px;"></div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
	<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/ueditor.config.js}"></script>
	<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/ueditor.all.js}"></script>

	<script th:inline="javascript" type="text/javascript">
		var prefix = ctx + "system/ncStage";
		$("#form-ncStage-edit").validate({
			rules: {
				stageDays: {
					required: true,
					number:true,
					digits:true,
					min:0
				},
				orderNum: {
					required: true,
					number:true,
					digits:true,
					min:0
				},
				stageName:{
					required: true,
				}
			},
			messages: {
				stageDays: {
					required: "请输入阶段天数",
					digits:"请输入正整数"
				},
				orderNum: {
					required: "请输入阶段天数",
					digits:"请输入正整数"
				}
			},
			focusCleanup: true
		});
		
		function submitHandler() {
            $('#stageDetail').val(ue.getContent());
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-ncStage-edit').serialize());
	        }
	    }


        var ue = UE.getEditor('editor', {
            initialFrameWidth: 755,
            initialFrameHeight: 600
        });
        ue.ready(function () {
            //设置编辑器的内容
            ue.setContent([[${ncStage.stageDetail}]]);
        });


	</script>
</body>
</html>
